const requireContext = require.context('@/tpl', true, /\.tpl$/);
const templates = {};

requireContext.keys().forEach(fileName => {
  const templateName = fileName.replace(/(\.\/|\.tpl)/g, '');
  templates[templateName] = requireContext(fileName).default;
});

export default templates;